package com.job.shuang.HomeWork0712;

/**
 * @author Liushuang
 * @version 1.0
 * @since 2022-07-12 20:37:00
 */
public class Tiger {
    private String name;
    private Attack attack;//关联策略

    public Tiger() {

    }

    public void fly(){
        if (attack!=null) {
            //当关联的策略类型被赋值为实现类对象时，被赋值为...
            attack.attackAction();
            return;
        }
        System.out.println("狮子的默认击打能力！");
    }


    public Tiger(String name) {
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Attack getAttack(Object canAttack) {
        return attack;
    }

    public void setAttack(Attack attack) {
        this.attack = attack;
    }

    public void Attack(String num) {
    }

    public boolean setAttack() {
        return false;
    }
}
